package me.lc.superDown.sprite;

import me.lc.superDown.entity.PlatformLocation;

import com.wiyun.engine.nodes.Node;
import com.wiyun.engine.nodes.Sprite;
import com.wiyun.game.model.a.ab;

/**
 * 平台
 * 
 * @author Administrator
 * 
 */
public abstract class Platform extends Node {
	protected Sprite sp;
	public PlatformLocation location;

	private boolean canStand = true;

	private boolean isManLanded = false;

	public boolean isManLanded() {
		return isManLanded;
	}

	public void setManLanded(boolean isManLanded) {
		this.isManLanded = isManLanded;
	}

	private boolean isManLeaved = false;

	private GameTool tool;

	public GameTool getTool() {
		return tool;
	}

	public void setTool(GameTool tool) {
		this.tool = tool;
	}

	public boolean isManLeaved() {
		return isManLeaved;
	}

	public void setManLeaved(boolean isManLeaved) {
		this.isManLeaved = isManLeaved;
	}

	public boolean isCanStand() {
		return canStand;
	}

	public void setCanStand(boolean canStand) {
		this.canStand = canStand;
	}

	public Platform() {
		createPlatformSprite();
		this.addChild(sp);
		location = new PlatformLocation();
	}

	public void setLocationInfo(float x, float y) {
		location.setY(y);
		location.setStartX(x - getPlatformWidth() / 2);
		location.setEndX(x + getPlatformWidth() / 2);
	}

	protected abstract void createPlatformSprite();

	public abstract float getPlatformWidth();

	public abstract void standPlatform();

	public abstract void leavePlatform();

}
